package cn.tedu.shoppingmall.mapper;

import cn.tedu.shoppingmall.vo.Images;
import org.apache.ibatis.annotations.Insert;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mapstruct.Mapper;

@Mapper
public interface ImgsMapper {
    //增加商品更多图片---放这里不合理,不过不想改了
    @Insert("insert into imgs(comid,url1,url2,url3,url4,url5,url6,url7,url8,url9,url10) " +
            "values(#{comid},#{url1},#{url2},#{url3},#{url4},#{url5},#{url6},#{url7},#{url8},#{url9},#{url10})")
    void insertImgs(Images images);


    //修改商品更多图片---放这里不合理,不过不想改了
    @Update("Update imgs set url1=#{url1},url2=#{url2},url3=#{url3},url4=#{url4}," +
            "url5=#{url5},url6=#{url6},url7=#{url7},url8=#{url8},url9=#{url9},url10=#{url10} where comid=#{comid}")
    void updateImgs(Images images);


    //图片集查询
    @Select("select url1,url2,url3,url4,url5,url6,url7,url8,url9,url10 from imgs where comid=#{comid}")
    Images SelectToIImgsByComId(int comid);

}
